// import { createApp } from 'vue'
// import App from './App.vue'
//
// createApp(App).mount('#app')
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { registerMicroApps, start } from 'qiankun';

const app = createApp(App);

// 注册微应用
registerMicroApps([
    // {
    //     name: 'vue2App', // 微应用名称
    //     entry: '//localhost:8081', // 微应用入口地址
    //     container: '#subapp-container', // 挂载容器
    //     activeRule: '/vue2-app', // 激活规则
    // },
    {
        name: 'nextjs-app',
        entry: '//http://192.168.65.40:3349/app',
        container: '#nextjs-app',
        activeRule: '/nextjs-app',
        props: {
            sharedState: { user: 'John Doe' }, // 示例数据
        },
    },
    {
        name: 'vue3-sub-app',
        entry: '//localhost:8082',
        container: '#vue3-sub-app',
        activeRule: '/vue3-sub-app',
    },
]);

// 启动 Qiankun
start({
    prefetch: 'all', // 预加载微应用资源
    sandbox: {
        experimentalStyleIsolation: true, // 开启样式隔离
    },
});

app.use(router).mount('#app');
